<?php
class CommentWidget extends CWidget{
    public $comment;
    public $type_j;
    public $type_s;
    public $id;
    public function init(){
    	if (isset($this->type_j)) {
	        $comments = Comment::model()->findAll("job_id=:x", array(':x'=>$this->id));
	        $this->render('comment',array('comment1'=>$this->comment,'comments'=>$comments, 'type'=>$this->type_j));
	    } else if(isset($this->type_s)) {
	    	$comments = Comment::model()->findAll("service_id=:x", array(':x'=>$this->id));
	        $this->render('comment',array('comment1'=>$this->comment,'comments'=>$comments, 'type'=>$this->type_s));
	    }
    	
	}
}
?>